}
lowranceusr_fread(&buff[0], 4, 1, file_in);
TextLen = buff[0];
- lowranceusr_fread(&buff[0], TextLen, 1, file_in);
+ if (TextLen)
+ lowranceusr_fread(&buff[0], TextLen, 1, file_in);
buff[TextLen] = '\0';
wpt_tmp->shortname = xstrdup(buff);
stringsize = buff[0];
- tpg_fread(&buff[0], stringsize, 1, tpg_file_in);
-
- buff[stringsize] = '\0';
+ if (stringsize)
+ tpg_fread(&buff[0], stringsize, 1, tpg_file_in);
+
+ buff[stringsize] = '\0';
wpt_tmp->shortname = xstrdup(buff);